
import { _decorator, Component, Node } from 'cc';
import AiComponent from './AiComponent';
const { ccclass, property } = _decorator;

/**
 * Predefined variables
 * Name = GameScene
 * DateTime = Sat Nov 27 2021 12:08:44 GMT+0800 (中国标准时间)
 * Author = 咕嘟喵
 * FileBasename = GameScene.ts
 * FileBasenameNoExtension = GameScene
 * URL = db://assets/scripts/scenes/gamescene/GameScene.ts
 * ManualUrl = https://docs.cocos.com/creator/3.3/manual/zh/
 *
 */
 
@ccclass('GameScene')
export class GameScene extends Component {
    // [1]
    // dummy = '';

    // [2]
    // @property
    // serializableDummy = 0;
    private _compai:AiComponent;
    onLoad(){
        
    }

    start () {
        console.log("Game Scene start");
        
        // [3]
        this._compai = new AiComponent();
        this._compai.start();
    }

    update(deltaTime: number) {
       if(this._compai)
        this._compai.update(deltaTime);
    }
}

/**
 * [1] Class member could be defined like this.
 * [2] Use `property` decorator if your want the member to be serializable.
 * [3] Your initialization goes here.
 * [4] Your update function goes here.
 *
 * Learn more about scripting: https://docs.cocos.com/creator/3.3/manual/zh/scripting/
 * Learn more about CCClass: https://docs.cocos.com/creator/3.3/manual/zh/scripting/ccclass.html
 * Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.3/manual/zh/scripting/life-cycle-callbacks.html
 */
